blob: 204c59ec9425657ee31d56b19522c22c145043fc [file] [log] [blame]
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -08001Gerrit Code Review - Access Controls
2====================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08003
4Access controls in Gerrit are group based. Every user account is a
5member of one or more groups, and access and privileges are granted
Matt Fischer620255a2011-03-22 14:28:23 -05006to those groups. Access rights cannot be granted to individual
7users.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08008
9
10System Groups
11-------------
12
Edwin Kempind2605ed2010-10-11 08:02:24 +020013Gerrit comes with 4 system groups, with special access privileges
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080014and membership management. The identity of these groups is set
15in the `system_config` table within the database, so the groups
16can be renamed after installation if desired.
17
Edwin Kempin913eab12011-05-06 08:18:24 +020018[[administrators]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080019Administrators
20~~~~~~~~~~~~~~
21
22This is the Gerrit "root" identity.
23
24Users in the 'Administrators' group can perform any action under
25the Admin menu, to any group or project, without further validation
David Pursehouse221d4f62012-06-08 17:38:08 +090026or any other access controls. In most installations only those
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080027users who have direct filesystem and database access would be
28placed into this group.
29
30Membership in the 'Administrators' group does not imply any other
31access rights. Administrators do not automatically get code review
32approval or submit rights in projects. This is a feature designed
Nico Sallembienee6eaf02010-02-01 13:24:49 -080033to permit administrative users to otherwise access Gerrit as any
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080034other normal user would, without needing two different accounts.
35
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010036[[anonymous_users]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080037Anonymous Users
38~~~~~~~~~~~~~~~
39
40All users are automatically a member of this group. Users who are
41not signed in are a member of only this group, and no others.
42
43Any access rights assigned to this group are inherited by all users.
44
45Administrators and project owners can grant access rights to this
46group in order to permit anonymous users to view project changes,
47without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010048to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080049identity for all other operations.
50
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010051[[non-interactive_users]]
52Non-Interactive Users
53~~~~~~~~~~~~~~~~~~~~~
54
55This is an internal user group, members of this group are not expected
56to perform interactive operations on the Gerrit web frontend.
57
58However, sometimes such a user may need a separate thread pool in
59order to prevent it from grabbing threads from the interactive users.
60
61These users live in a second thread pool, which separates operations
62made by the non-interactive users from the ones made by the interactive
63users. This ensures that the interactive users can keep working when
64resources are tight.
65
66[[project_owners]]
67Project Owners
68~~~~~~~~~~~~~~
69
70Access rights assigned to this group are always evaluated within the
71context of a project to which the access rights apply. These rights
72therefore apply to all the users who are owners of this project.
73
74By assigning access rights to this group on a parent project Gerrit
75administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010076<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010077access rights where they are resolved to the users that own the child
78project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010079<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010080avoid the need to initially configure access rights for
81newly created child projects.
82
83[[registered_users]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080084Registered Users
85~~~~~~~~~~~~~~~~
86
87All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +010088also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080089
90Any access rights assigned to this group are inherited by all
91users as soon as they sign-in to Gerrit. If OpenID authentication
92is being employed, moving from only 'Anonymous Users' into this
93group is very easy. Caution should be taken when assigning any
94permissions to this group.
95
96It is typical to assign `Code Review -1..+1` to this group,
97allowing signed-in users to vote on a change, but not actually
98cause it to become approved or rejected.
99
100Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100101on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800102
103
104Account Groups
105--------------
106
107Account groups contain a list of zero or more user account members,
108added individually by a group owner. Any user account listed as
109a group member is given any access rights granted to the group.
110
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800111Every group has one other group designated as its owner. Users who
112are members of the owner group can:
113
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100114* Add users and other groups to this group
115* Remove users and other groups from this group
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800116* Change the name of this group
117* Change the description of this group
118* Change the owner of this group, to another group
119
120It is permissible for a group to own itself, allowing the group
121members to directly manage who their peers are.
122
123Newly created groups are automatically created as owning themselves,
124with the creating user as the only member. This permits the group
125creator to add additional members, and change the owner to another
126group if desired.
127
128It is somewhat common to create two groups at the same time,
129for example `Foo` and `Foo-admin`, where the latter group
130`Foo-admin` owns both itself and also group `Foo`. Users who
131are members of `Foo-admin` can thus control the membership of
132`Foo`, without actually having the access rights granted to `Foo`.
133This configuration can help prevent accidental submits when the
134members of `Foo` have submit rights on a project, and the members of
135`Foo-admin` typically do not need to have such rights.
136
137
138Project Access Control Lists
139----------------------------
140
lincolnfa7bdd32010-04-22 14:23:05 -0300141A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700142project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300143through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800144
145Per-project access control lists are also supported.
146
147Users are permitted to use the maximum range granted to any of their
148groups in an approval category. For example, a user is a member of
149`Foo Leads`, and the following ACLs are granted on a project:
150
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100151[options="header"]
152|=================================================
153|Group |Reference Name |Category|Range
154|Anonymous Users |refs/heads/*|Code Review|-1..+1
155|Registered Users|refs/heads/*|Code Review|-1..+2
156|Foo Leads |refs/heads/*|Code Review|-2..0
157|=================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800158
159Then the effective range permitted to be used by the user is
160`-2..+2`, as the user is a member of all three groups (see above
161about the system groups) and the maximum range is chosen (so the
162lowest value granted to any group, and the highest value granted
163to any group).
164
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800165Reference-level access control is also possible.
166
167Permissions can be set on a single reference name to match one
168branch (e.g. `refs/heads/master`), or on a reference namespace
Edwin Kempina2bf0832011-09-08 14:23:30 +0200169(e.g. `refs/heads/*`) to match any branch starting with that
170prefix. So a permission with `refs/heads/*` will match
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800171`refs/heads/master` and `refs/heads/experimental`, etc.
172
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700173Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200174by prefixing the reference name with `^`. For example
175`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700176between 1 and 8 characters long. Within a regular expression `.`
177is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100178The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
179is used for evaluation of regular expression access control
180rules. See the library documentation for details on this
181particular regular expression flavor.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700182
183References can have the current user name automatically included,
184creating dynamic access controls that change to match the currently
185logged in user. For example to provide a personal sandbox space
Edwin Kempina2bf0832011-09-08 14:23:30 +0200186to all developers, `refs/heads/sandbox/${username}/*` allowing
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700187the user 'joe' to use 'refs/heads/sandbox/joe/foo'.
188
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800189When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700190the full set of access rights to determine if the user
191is allowed to perform a given action. For example, if a user is a
192member of `Foo Leads`, they are reviewing a change destined for
193the `refs/heads/qa` branch, and the following ACLs are granted
194on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800195
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100196[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100197|===============================================================
198|Group |Reference Name|Category |Range |Exclusive
199|Registered Users |refs/heads/* |Code Review| -1..+1 |
200|Foo Leads |refs/heads/* |Code Review| -2..+2 |
201|QA Leads |refs/heads/qa |Code Review| -2..+2 |
202|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800203
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700204Then the effective range permitted to be used by the user is
205`-2..+2`, as the user's membership of `Foo Leads` effectively grant
206them access to the entire reference space, thanks to the wildcard.
207
208Gerrit also supports exclusive reference-level access control.
209
210It is possible to configure Gerrit to grant an exclusive ref level
211access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100212an operation on a project/reference pair. This is done by ticking
213the exclusive flag when setting the permission for the
214`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700215
216For example, if a user who is a member of `Foo Leads` tries to
217review a change destined for branch `refs/heads/qa` in a project,
218and the following ACLs are granted:
219
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100220[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100221|==============================================================
222|Group |Reference Name|Category |Range |Exclusive
223|Registered Users|refs/heads/* |Code Review| -1..+1 |
224|Foo Leads |refs/heads/* |Code Review| -2..+2 |
225|QA Leads |refs/heads/qa |Code Review| -2..+2 |X
226|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700227
228Then this user will not have `Code Review` rights on that change,
229since there is an exclusive access right in place for the
230`refs/heads/qa` branch. This allows locking down access for a
231particular branch to a limited set of users, bypassing inherited
232rights and wildcards.
233
234In order to grant the ability to `Code Review` to the members of
235`Foo Leads`, in `refs/heads/qa` then the following access rights
236would be needed:
237
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100238[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100239|==============================================================
240|Group |Reference Name|Category |Range |Exclusive
241|Registered Users|refs/heads/* |Code Review| -1..+1 |
242|Foo Leads |refs/heads/* |Code Review| -2..+2 |
243|QA Leads |refs/heads/qa |Code Review| -2..+2 |X
244|Foo Leads |refs/heads/qa |Code Review| -2..+2 |
245|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700246
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800247OpenID Authentication
248~~~~~~~~~~~~~~~~~~~~~
249
250If the Gerrit instance is configured to use OpenID authentication,
251an account's effective group membership will be restricted to only
252the `Anonymous Users` and `Registered Users` groups, unless *all*
253of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700254in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800255
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800256All Projects
257~~~~~~~~~~~~
258
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700259Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800260is automatically inherited by every other project in the same
261Gerrit instance. These rights can be seen, but not modified,
262in any other project's `Access` administration tab.
263
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100264Only members of the groups with the `Administrate Server` capability
265may edit the access control list for `All-Projects`. By default this
266capability is given to the group `Administrators`, but can be given
267to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700268
269Ownership of this project cannot be delegated to another group.
270This restriction is by design. Granting ownership to another
271group gives nearly the same level of access as membership in
272`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100273permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700274
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800275Per-Project
276~~~~~~~~~~~
277
Fredrik Luthanderda867882011-12-21 18:28:40 +0100278The per-project ACL is evaluated before the global `All-Projects` ACL,
279permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100280behavior is generally only useful on the `Read` category when
281granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800282
283
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100284[[access_category]]
285Access Categories
286-----------------
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800287
288Gerrit comes pre-configured with several default categories that
289can be granted to groups within projects, enabling functionality
290for that group's members.
291
Fredrik Luthander71267062011-12-21 18:38:45 +0100292With the release of the Gerrit 2.2.x series, the web GUI for ACL
293configuration was rewritten from scratch. Use this
294<<conversion_table,table>> to better understand the access rights
295conversions from the Gerrit 2.1.x to the Gerrit 2.2.x series.
296
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800297
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100298[[category_label-Verified]]
299Label: Verified
300~~~~~~~~~~~~~~~
301
302The verified category is one of two default categories that is
303configured upon the creation of a Gerrit instance. It may have
304any meaning the project desires. It was originally invented by
305the Android Open Source Project to mean
306'compiles, passes basic unit tests'.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800307
308The range of values is:
309
310* -1 Fails
311+
312Tried to compile, but got a compile error, or tried to run tests,
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100313but one or more tests did not pass. This value is valid
314across all patch sets in the same change, i.e. the reviewer must
315actively change his/her review to something else before the change
316is submittable.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800317+
318*Any -1 blocks submit.*
319
320* 0 No score
321+
322Didn't try to perform the verification tasks.
323
324* +1 Verified
325+
326Compiled (and ran tests) successfully.
327+
328*Any +1 enables submit.*
329
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100330For a change to be submittable, the change must have a `+1 Verified`
331in this category from at least one authorized user, and no `-1 Fails`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800332from an authorized user. Thus, `-1 Fails` can block a submit,
333while `+1 Verified` enables a submit.
334
335If a Gerrit installation does not wish to use this category in any
336project, it can be deleted from the database:
337
338====
339 DELETE FROM approval_categories WHERE category_id = 'VRIF';
340 DELETE FROM approval_category_values WHERE category_id = 'VRIF';
341====
342
343If a Gerrit installation wants to modify the description text
344associated with these category values, the text can be updated
Edwin Kempina2bf0832011-09-08 14:23:30 +0200345in the `name` column of the `category_id = 'VRIF'` rows in the
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800346`approval_category_values` table.
347
348Additional values could also be added to this category, to allow it
349to behave more like `Code Review` (below). Insert -2 and +2 value
350rows into the `approval_category_values` with `category_id` set to
351`VRIF` to get the same behavior.
352
353[NOTE]
354A restart is required after making database changes.
355See <<restart_changes,below>>.
356
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100357[[category_label-Code-Review]]
358Label: Code Review
359~~~~~~~~~~~~~~~~~~
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800360
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100361The code review category is the second of two default categories that
362is configured upon the creation of a Gerrit instance. It may have
363any meaning the project desires. It was originally invented by the
364Android Open Source Project to mean 'I read the code and it seems
365reasonably correct'.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800366
367The range of values is:
368
369* -2 Do not submit
370+
371The code is so horribly incorrect/buggy/broken that it must not be
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100372submitted to this project, or to this branch. This value is valid
373across all patch sets in the same change, i.e. the reviewer must
374actively change his/her review to something else before the change
375is submittable.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800376+
377*Any -2 blocks submit.*
378
379* -1 I would prefer that you didn't submit this
380+
381The code doesn't look right, or could be done differently, but
382the reviewer is willing to live with it as-is if another reviewer
383accepts it, perhaps because it is better than what is currently in
384the project. Often this is also used by contributors who don't like
385the change, but also aren't responsible for the project long-term
386and thus don't have final say on change submission.
387+
388Does not block submit.
389
390* 0 No score
391+
392Didn't try to perform the code review task, or glanced over it but
393don't have an informed opinion yet.
394
395* +1 Looks good to me, but someone else must approve
396+
397The code looks right to this reviewer, but the reviewer doesn't
398have access to the `+2` value for this category. Often this is
399used by contributors to a project who were able to review the change
400and like what it is doing, but don't have final approval over what
401gets submitted.
402
403* +2 Looks good to me, approved
404+
405Basically the same as `+1`, but for those who have final say over
406how the project will develop.
407+
408*Any +2 enables submit.*
409
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100410For a change to be submittable, the latest patch set must have a
411`+2 Looks good to me, approved` in this category from at least one
412authorized user, and no `-2 Do not submit` from an authorized user.
413Thus `-2` on any patch set can block a submit, while `+2` on the
414latest patch set can enable it.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800415
416If a Gerrit installation does not wish to use this category in any
417project, it can be deleted from the database:
418
419====
420 DELETE FROM approval_categories WHERE category_id = 'CRVW';
421 DELETE FROM approval_category_values WHERE category_id = 'CRVW';
422====
423
424If a Gerrit installation wants to modify the description text
425associated with these category values, the text can be updated
Edwin Kempina2bf0832011-09-08 14:23:30 +0200426in the `name` column of the `category_id = 'CRVW'` rows in the
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800427`approval_category_values` table.
428
429Additional values could be inserted into `approval_category_values`
430to further extend the negative and positive range, but there is
431likely little value in doing so as this only expands the middle
432region. This category is a `MaxWithBlock` type, which means that
433the lowest negative value if present blocks a submit, while the
434highest positive value is required to enable submit.
435
Shawn O. Pearce2d524492010-02-22 07:28:14 -0800436[[function_MaxNoBlock]]
Shane Mc Cormack66376d02010-01-29 19:12:58 +0000437There is also a `MaxNoBlock` category which still requires the
438highest positive value to submit, but the lowest negative value will
439not block the change, and does not carry over between patch sets.
440This level is mostly useful for automated code-reviews that may
441have false-negatives that shouldn't block the change.
442
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800443[NOTE]
444A restart is required after making database changes.
445See <<restart_changes,below>>.
446
Chad Horohoe029c85a2012-06-07 16:10:14 -0400447[[category_abandon]]
448Abandon
Edwin Kempin3ff05112012-07-19 14:43:25 +0200449~~~~~~~
Chad Horohoe029c85a2012-06-07 16:10:14 -0400450
451This category controls whether users are allowed to abandon changes
452to projects in Gerrit. It can give permission to abandon a specific
453change to a given ref.
454
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400455This also grants the permission to restore a change if the change
456can be uploaded.
457
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100458[[category_create]]
459Create reference
460~~~~~~~~~~~~~~~~
461
462The create reference category controls whether it is possible to
463create new references, branches or tags. This implies that the
464reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900465in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100466references (and also discard any commits in the process).
467
468It's probably most common to either permit the creation of a single
469branch in many gits (by granting permission on a parent project), or
470to grant this permission to a name pattern of branches.
471
472This permission is often given in conjunction with regular push
473branch permissions, allowing the holder of both to create new branches
474as well as bypass review for new commits on that branch.
475
David Pursehouse221d4f62012-06-08 17:38:08 +0900476To push lightweight (non-annotated) tags, grant
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100477`Create Reference` for reference name `refs/tags/*`, as lightweight
478tags are implemented just like branches in Git.
479
480For example, to grant the possibility to create new branches under the
481namespace `foo`, you have to grant this permission on
482`refs/heads/foo/*` for the group that should have it.
483Finally, if you plan to grant each user a personal namespace in
484where they are free to create as many branches as they wish, you
485should grant the create reference permission so it's possible
486to create new branches. This is done by using the special
487`${username}` keyword in the reference pattern, e.g.
488`refs/heads/sandbox/${username}/*`. If you do, it's also recommended
489you grant the users the push force permission to be able to clean up
490stale branches.
491
492
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100493[[category_forge_author]]
494Forge Author
495~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100496
497Normally Gerrit requires the author and the committer identity
498lines in a Git commit object (or tagger line in an annotated tag) to
499match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100500This permission allows users to bypass parts of that validation, which
501may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100502
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100503Permits the use of an unverified author line in commit objects.
504This can be useful when applying patches received by email from
5053rd parties, when cherry-picking changes written by others across
506branches, or when amending someone else's commit to fix up a minor
507problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100508
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100509By default this is granted to `Registered Users` in all projects,
510but a site administrator may disable it if verified authorship
511is required.
512
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100513
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100514[[category_forge_committer]]
515Forge Committer
516~~~~~~~~~~~~~~~
517
518Normally Gerrit requires the author and the committer identity
519lines in a Git commit object (or tagger line in an annotated tag) to
520match one of the registered email addresses of the uploading user.
521This permission allows users to bypass parts of that validation, which
522may be necessary when mirroring changes from an upstream project.
523
524Allows the use of an unverified committer line in commit objects, or an
525unverified tagger line in annotated tag objects. Typically this is only
526required when mirroring commits from an upstream project repository.
527
528
529[[category_forge_server]]
530Forge Server
531~~~~~~~~~~~~
532
533Normally Gerrit requires the author and the committer identity
534lines in a Git commit object (or tagger line in an annotated tag) to
535match one of the registered email addresses of the uploading user.
536This permission allows users to bypass parts of that validation, which
537may be necessary when mirroring changes from an upstream project.
538
539Allows the use of the server's own name and email on the committer
540line of a new commit object. This should only be necessary when force
541pushing a commit history which has been rewritten by 'git filter-branch'
542and that contains merge commits previously created by this Gerrit Code
543Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100544
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100545
546[[category_owner]]
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100547Owner
548~~~~~
549
550The `Owner` category controls which groups can modify the project's
551configuration. Users who are members of an owner group can:
552
553* Change the project description
554* Create/delete a branch through the web UI (not SSH)
555* Grant/revoke any access rights, including `Owner`
556
557Note that project owners implicitly have branch creation or deletion
558through the web UI, but not through SSH. To get SSH branch access
559project owners must grant an access right to a group they are a
560member of, just like for any other user.
561
562Ownership over a particular branch subspace may be delegated by
563entering a branch pattern. To delegate control over all branches
564that begin with `qa/` to the QA group, add `Owner` category
565for reference `refs/heads/qa/\*`. Members of the QA group can
566further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100567`refs/heads/qa/`. See <<project_owners,project owners>> to find
568out more about this role.
569
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100570
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100571[[category_push]]
572Push
573~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100574
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100575This category controls how users are allowed to upload new commits
576to projects in Gerrit. It can either give permission to push
577directly into a branch, bypassing any code review process
578that would otherwise be used. Or it may give permission to upload
579new changes for code review, this depends on which namespace the
580permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100581
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100582
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100583[[category_push_direct]]
584Direct Push
585^^^^^^^^^^^
586
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100587Any existing branch can be fast-forwarded to a new commit.
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100588Creation of new branches is controlled by the
589link:access-control.html#category_create['Create Reference']
590category. Deletion of existing branches is rejected. This is the
591safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100592
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100593* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100594+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100595Allows an existing branch to be deleted. Since a force push is
596effectively a delete immediately followed by a create, but performed
597atomically on the server and logged, this option also permits forced
598push updates to branches. Enabling this option allows existing commits
599to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100600
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100601The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100602take advantage of Gerrit's access control features and do not need
603its code review functionality. Projects that need to require code
604reviews should not grant this category.
605
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100606
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100607[[category_push_review]]
608Upload To Code Review
609^^^^^^^^^^^^^^^^^^^^^
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100610
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100611The `Push` access right granted on the namespace
612`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
613commit to the project's `refs/for/BRANCH` namespace, creating a new
614change for code review.
615
616A user must be able to clone or fetch the project in order to create
617a new commit on their local system, so in practice they must also
618have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100619
620For an open source, public Gerrit installation, it is common to
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100621grant `Read` and `Push` for `refs/for/refs/heads/*`
622to `Registered Users` in the `All-Projects` ACL. For more
623private installations, its common to simply grant `Read` and
624`Push` for `refs/for/refs/heads/*` to all users of a project.
625
626* Force option
627+
628The force option has no function when granted to a branch in the
629`refs/for/refs/heads/*` namespace.
630
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100631
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100632[[category_push_merge]]
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100633Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100634~~~~~~~~~~~~~~~~~~~~
635
Magnus Bäck282c1022012-04-18 15:39:17 -0400636The `Push Merge Commit` access right permits the user to upload merge
637commits. It's an addon to the <<category_push,Push>> access right, and
638so it won't be sufficient with only `Push Merge Commit` granted for a
639push to happen. Some projects wish to restrict merges to being created
640by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100641merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100642
Magnus Bäck282c1022012-04-18 15:39:17 -0400643The reference name connected to a `Push Merge Commit` entry must always
644be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
645This applies even for an entry that complements a `Push` entry for
646`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
647the intention of the `Push Merge Commit` entry is to allow direct pushes
648of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100649
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100650[[category_push_annotated]]
651Push Annotated Tag
652~~~~~~~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100653
654This category permits users to push an annotated tag object over
655SSH into the project's repository. Typically this would be done
656with a command line such as:
657
658====
659 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
660====
661
662Tags must be annotated (created with `git tag -a` or `git tag -s`),
663should exist in the `refs/tags/` namespace, and should be new.
664
665This category is intended to be used to publish tags when a project
666reaches a stable release point worth remembering in history.
667
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100668It allows for a new annotated (unsigned) tag to be created. The
669tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100670
671To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100672as tags mirrored from an upstream project), `Forge Committer Identity`
673must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100674
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100675To push lightweight (non annotated) tags, grant
676<<category_create,`Create Reference`>> for reference name
677`refs/tags/*`, as lightweight tags are implemented just like
678branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100679
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100680To delete or overwrite an existing tag, grant `Push` with the force
681option enabled for reference name `refs/tags/*`, as deleting a tag
682requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100683
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100684
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100685[[category_read]]
686Read
687~~~~
688
689The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100690changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100691A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100692changes, or any of its data.
693
694This category has a special behavior, where the per-project ACL is
695evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100696ACL has granted `Read` with 'DENY', and does not otherwise grant
697`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100698is ignored. This behavior is useful to hide a handful of projects
699on an otherwise public server.
700
701For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100702`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
703casual browsing of any project's changes, as well as fetching any
704project's repository over SSH or HTTP. New projects can be
705temporarily hidden from public view by granting `Read` with 'DENY'
706to `Anonymous Users` and granting `Read` to the project owner's
707group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100708
709For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100710source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100711typical, enabling read access only to those users who have been
712able to authenticate through the HTTP access controls. This may
713be suitable in a corporate deployment if the HTTP access control
714is already restricted to the correct set of users.
715
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100716
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200717[[category_rebase]]
718Rebase
719~~~~~~
720
721This category permits users to rebase changes via the web UI by pushing
722the `Rebase Change` button.
723
724The change owner and submitters can always rebase changes in the web UI
725(even without having the `Rebase` access right assigned).
726
727Users without this access right who are able to upload new patch sets
728can still do the rebase locally and upload the rebased commit as a new
729patch set.
730
Chad Horohoec626f3c2012-09-13 11:04:20 -0700731[[category_remove_reviewer]]
732Remove Reviewer
733~~~~~~~~~~~~~~~
734
735This category permits users to remove other users from the list of
736reviewers on a change.
737
738The change owner, project owner and site administrator can always
739remove reviewers (even without having the `Remove Reviewer` access
740right assigned).
741
742Users without this access right can only remove themselves from the
743reviewer list on a change.
744
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200745
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100746[[category_submit]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800747Submit
748~~~~~~
749
750This category permits users to push the `Submit Patch Set n` button
751on the web UI.
752
753Submitting a change causes it to be merged into the destination
754branch as soon as possible, making it a permanent part of the
755project's history.
756
757In order to submit, all approval categories (such as `Verified` and
758`Code Review`, above) must enable submit, and also must not block it.
759See above for details on each category.
760
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100761
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800762[[category_makeoneup]]
763Your Category Here
764~~~~~~~~~~~~~~~~~~
765
766Gerrit administrators can also make up their own categories.
767
Fredrik Luthander54abc352012-01-20 16:18:41 +0100768See above for descriptions of how <<category_verified,`Verified`>>
769and <<category_review,`Code Review`>> work, and insert your own
770category with `function_name = 'MaxWithBlock'` to get the same
771behavior over your own range of values, in any category you desire.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800772
773Ensure `category_id` is unique within your `approval_categories`
774table. The default values `VRIF` and `CVRF` used for the categories
775described above are simply that, defaults, and have no special
Fredrik Luthander54abc352012-01-20 16:18:41 +0100776meaning to Gerrit.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800777
778The `position` column of `approval_categories` controls which column
779of the 'Approvals' table the category appears in, providing some
780layout control to the administrator.
781
782All `MaxWithBlock` categories must have at least one positive value
783in the `approval_category_values` table, or else submit will never
784be enabled.
785
786To permit blocking submits, ensure a negative value is defined for
787your new category. If you do not wish to have a blocking submit
788level for your category, do not define values less than 0.
789
790Keep in mind that category definitions are currently global to
791the entire Gerrit instance, and affect all projects hosted on it.
792Any change to a category definition affects everyone.
793
794For example, to define a new 3-valued category that behaves exactly
795like `Verified`, but has different names/labels:
796
797====
798 INSERT INTO approval_categories
799 (name
800 ,position
801 ,function_name
802 ,category_id)
803 VALUES
804 ('Copyright Check'
805 ,3
Edwin Kempina164c2d2012-01-10 13:59:46 +0100806 ,'MaxWithBlock'
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800807 ,'copy');
808
809 INSERT INTO approval_category_values
810 (category_id,value,name)
811 VALUES
812 ('copy', -1, 'Do not have copyright');
813
814 INSERT INTO approval_category_values
815 (category_id,value,name)
816 VALUES
817 ('copy', 0, 'No score');
818
819 INSERT INTO approval_category_values
820 (category_id,value,name)
821 VALUES
822 ('copy', 1, 'Copyright clear');
823====
824
825The new column will appear at the end of the table (in position 3),
826and `-1 Do not have copyright` will block submit, while `+1 Copyright
827clear` is required to enable submit.
828
Edwin Kempin7dcd1052012-03-22 16:04:13 +0100829[[restart_changes]]
830[NOTE]
831Restart the Gerrit web application and reload all browsers after
832making any database changes to approval categories. Browsers are
833sent the list of known categories when they first visit the site,
834and don't notice changes until the page is closed and opened again,
835or is reloaded.
836
Fredrik Luthander71267062011-12-21 18:38:45 +0100837
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100838Examples of typical roles in a project
839--------------------------------------
840
841Below follows a set of typical roles on a server and which access
842rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900843general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100844brand new Gerrit instance.
845
846[[examples_contributor]]
847Contributor
848~~~~~~~~~~~
849
850This is the typical user on a public server. They are able to read
851your project and upload new changes to it. They are able to give
852feedback on other changes as well, but are unable to block or approve
853any changes.
854
855Suggested access rights to grant:
856
857* <<category_read,`Read`>> on 'refs/heads/\*' and 'refs/tags/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200858* <<category_push,`Push`>> to 'refs/for/refs/heads/*'
859* <<category_label-Code-Review,`Code review`>> with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100860
861
Fredrik Luthander654161c2012-01-31 14:42:36 +0100862[[examples_developer]]
863Developer
864~~~~~~~~~
865
866This is the typical core developer on a public server. They are able
867to read the project, upload changes to a branch. They are allowed to
868push merge commits to merge branches together. Also, they are allowed
869to forge author identity, thus handling commits belonging to others
870than themselves, effectively allowing them to transfer commits
871between different branches.
872
873They are furthermore able to code review and verify commits, and
874eventually submit them. If you have an automated CI system that
875builds all uploaded patch sets you might want to skip the
876verification rights for the developer and let the CI system do that
877exclusively.
878
879Suggested access rights to grant:
880
881* <<category_read,`Read`>> on 'refs/heads/\*' and 'refs/tags/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200882* <<category_push,`Push`>> to 'refs/for/refs/heads/*'
883* <<category_push_merge,`Push merge commit`>> to 'refs/for/refs/heads/*'
884* <<category_forge_author,`Forge Author Identity`>> to 'refs/heads/*'
885* <<category_label-Code-Review,`Label: Code review`>> with range '-2' to '+2' for 'refs/heads/*'
886* <<category_label-Verified,`Label: Verify`>> with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthander654161c2012-01-31 14:42:36 +0100887* <<category_submit,`Submit`>>
888
889If the project is small or the developers are seasoned it might make
890sense to give them the freedom to push commits directly to a branch.
891
892Optional access rights to grant:
893
894* <<category_push,`Push`>> to 'refs/heads/*'
895* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
896
897
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100898[[examples_cisystem]]
899CI system
900~~~~~~~~~
901
902A typical Continous Integration system should be able to download new changes
903to build and then leave a verdict somehow.
904
905As an example, the popular
906link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
907for Jenkins/Hudson can set labels at:
908
909* The start of a build
910* A successful build
911* An unstable build (tests fails)
912* A failed build
913
914Usually the range chosen for this verdict is the verify label. Depending on
915the size of your project and discipline of involved developers you might want
916to limit access right to the +1 `Verify` label to the CI system only. That
917way it's guaranteed that submitted commits always get built and pass tests
918successfully.
919
920If the build doesn't complete successfully the CI system can set the
921`Verify` label to -1. However that means that a failed build will block
922submit of the change even if someone else sets `Verify` +1. Depending on the
923project and how much the CI system can be trusted for accurate results, a
924blocking label might not be feasible. A recommended alternative is to set the
925label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900926shows a red label in the Gerrit UI. Optionally, to enable the possibility to
927deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100928possible to set `Code-review` +1 as well.
929
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200930If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100931submitted changes for upload to other branches under certain conditions. This
932is probably not the first step of what a project wants to automate however,
933and so the push right can be found under the optional section.
934
935Suggested access rights to grant, that won't block changes:
936
937* <<category_read,`Read`>> on 'refs/heads/\*' and 'refs/tags/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200938* <<category_label-Code-Review,`Label: Code review`>> with range '-1' to '0' for 'refs/heads/*'
939* <<category_label-Verified,`Label: Verify`>> with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100940
941Optional access rights to grant:
942
Fredrik Luthander404a2852012-10-10 08:51:22 +0200943* <<category_label-Code-Review,`Label: Code review`>> with range '-1' to '+1' for 'refs/heads/*'
944* <<category_push,`Push`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100945
946
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100947[[examples_integrator]]
948Integrator
949~~~~~~~~~~
950
951Integrators are like developers but with some additional rights granted due
952to their administrative role in a project. They can upload or push any commit
953with any committer email (not just their own) and they can also create new
954tags and branches.
955
956Suggested access rights to grant:
957
958* <<examples_developer,Developer rights>>
959* <<category_push,`Push`>> to 'refs/heads/*'
960* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200961* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100962* <<category_create,`Create Reference`>> to 'refs/heads/*'
963* <<category_push_annotated,`Push Annotated Tag`>> to 'refs/tags/*'
964
965
Fredrik Luthander9c645362012-03-22 18:10:42 +0100966[[examples_project-owner]]
967Project owner
968~~~~~~~~~~~~~
969
970The project owner is almost like an integrator but with additional destructive
971power in the form of being able to delete branches. Optionally these users
972also have the power to configure access rights in gits assigned to them.
973
974[WARNING]
975These users should be really knowledgable about git, for instance knowing why
976tags never should be removed from a server. This role is granted potentially
977destructive access rights and cleaning up after such a mishap could be time
978consuming!
979
980Suggested access rights to grant:
981
982* <<examples_integrator,Integrator rights>>
983* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
984
985Optional access right to grant:
986
987* <<category_owner,`Owner`>> in the gits they mostly work with.
988
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100989[[examples_administrator]]
990Administrator
991~~~~~~~~~~~~~
992
993The administrator role is the most powerful role known in the Gerrit universe.
994This role may grant itself (or others) any access right, and it already has
995all capabilities granted as well. By default the
996<<administrators,`Administrators` group>> is the group that has this role.
997
998Mandatory access rights:
999
1000* <<capability_administrateServer,The `Administrate Server` capability>>
1001
1002Suggested access rights to grant:
1003
1004* <<examples_project-owner,Project owner rights>>
1005
Fredrik Luthander9c645362012-03-22 18:10:42 +01001006
Fredrik Luthander71267062011-12-21 18:38:45 +01001007[[conversion_table]]
1008Conversion table from 2.1.x series to 2.2.x series
1009--------------------------------------------------
1010
1011[options="header"]
1012|=================================================================================
1013|Gerrit 2.1.x |Gerrit 2.2.x
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001014|Code review |<<category_label-Code-Review,Label: Code review>>
1015|Verify |<<category_label-Verified,Label: Verify>>
1016|Forge Identity +1 |Forge <<category_forge_author,author>> identity
1017|Forge Identity +2 |Forge <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
1018|Forge Identity +3 |Forge <<category_forge_server,server>> & <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
1019|Owner |<<category_owner,Owner>>
1020|Push branch +1 |<<category_push_direct,Push>>
1021|Push branch +2 |<<category_create,Create reference>> & <<category_push_direct,Push>>
1022|Push branch +3 |<<category_push_direct,Push>> (with force) & <<category_create,Create reference>>
Fredrik Luthander71267062011-12-21 18:38:45 +01001023|Push tag +1 & Push Branch +2 |No support to limit to push signed tag
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001024|Push tag +2 & Push Branch +2 |<<category_push_annotated,Push annotated tag>>
1025|Push Branch +2 (refs/tags/*) |<<category_create,Create reference>> (refs/tags/...)
1026|Push Branch +3 (refs/tags/*) |<<category_push_direct,Push>> (with force on refs/tags/...)
1027|Read +1 |<<category_read,Read>>
1028|Read +2 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...)
Edwin Kempinaef5d6e2012-01-24 09:04:54 +01001029|Read +3 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...) & <<category_push_merge,Push Merge Commit>>
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001030|Submit |<<category_submit,Submit>>
Fredrik Luthander71267062011-12-21 18:38:45 +01001031|=================================================================================
1032
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001033
Fredrik Luthander71267062011-12-21 18:38:45 +01001034[NOTE]
1035In Gerrit 2.2.x, the way to set permissions for upload has changed entirely.
1036To upload a change for review is no longer a separate permission type,
1037instead you grant ordinary push permissions to the actual
1038recieving reference. In practice this means that you set push permissions
1039on `refs/for/refs/heads/<branch>` rather than permissions to upload changes
1040on `refs/heads/<branch>`.
1041
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001042
1043System capabilities
1044-------------------
1045
1046The system capabilities control actions that the administrators of
1047the server can perform which usually affect the entire
1048server in some way. The administrators may delegate these
1049capabilities to trusted groups of users.
1050
1051Delegation of capabilities allows groups to be granted a subset of
1052administrative capabilities without being given complete
1053administrative control of the server. This makes it possible to
1054keep fewer users in the administrators group, even while spreading
1055much of the server administration burden out to more users.
1056
1057Below you find a list of capabilities available:
1058
1059
Fredrik Luthander426885f2012-02-13 09:56:57 +01001060[[capability_administrateServer]]
1061Administrate Server
1062~~~~~~~~~~~~~~~~~~~
1063
1064This is in effect the owner and administrator role of the Gerrit
1065instance. Any members of a group granted this capability will be
1066able to grant any access right to any group. They will also have all
1067capabilities granted to them automatically.
1068
1069
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001070[[capability_createAccount]]
1071Create Account
1072~~~~~~~~~~~~~~
1073
Fredrik Luthander79d38152012-03-13 09:52:22 +01001074Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001075This capability allows the granted group members to create non-interactive
1076service accounts. These service accounts are generally used for automation
1077and made to be members of the
1078link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1079
1080
Fredrik Luthander79d38152012-03-13 09:52:22 +01001081[[capability_createGroup]]
1082Create Group
1083~~~~~~~~~~~~
1084
1085Allow group creation. Groups are used to grant users access to different
1086actions in projects. This capability allows the granted group members to
1087either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1088
1089
1090[[capability_createProject]]
1091Create Project
1092~~~~~~~~~~~~~~
1093
1094Allow project creation. This capability allows the granted group to
1095either link:cmd-create-project.html[create new git projects via ssh]
1096or via the web UI.
1097
Sasa Zivkov812f4892012-06-21 16:25:21 +02001098[[capability_emailReviewers]]
1099Email Reviewers
1100~~~~~~~~~~~~~~~
1101
1102Allow or deny sending email to change reviewers and watchers. This can be used
1103to deny build bots from emailing reviewers and people who watch the change.
1104Instead, only the authors of the change and those who starred it will be
1105emailed. The allow rules are evaluated before deny rules, however the default
1106is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001107
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001108[[capability_flushCaches]]
1109Flush Caches
1110~~~~~~~~~~~~
1111
Fredrik Luthander48603002012-03-21 18:17:17 +01001112Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001113group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1114
1115[NOTE]
1116This capability doesn't imply permissions to the show-caches command. For that
1117you need the <<capability_viewCaches,view caches capability>>.
1118
1119
Fredrik Luthander46843022012-03-13 16:11:02 +01001120[[capability_kill]]
1121Kill Task
1122~~~~~~~~~
1123
1124Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1125kill command ends tasks that currently occupy the Gerrit server, usually
1126a replication task or a user initiated task such as an upload-pack or
1127recieve-pack.
1128
1129
1130[[capability_priority]]
1131Priority
1132~~~~~~~~
1133
1134This capability allows users to use
1135link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1136link:access-control.html#non-interactive_users['Non-Interactive Users'].
1137It's a binary value in that granted users either have access to the thread
1138pool, or they don't.
1139
1140There are three modes for this capability and they're listed by rising
1141priority:
1142
1143No capability configured.::
1144The user isn't a member of a group with any priority capability granted. By
1145default the user is then in the 'INTERACTIVE' thread pool.
1146
1147'BATCH'::
1148If there's a thread pool configured for 'Non-Interactive Users' and a user is
1149granted the priority capability with the 'BATCH' mode selected, the user ends
1150up in the separate batch user thread pool. This is true unless the user is
1151also granted the below 'INTERACTIVE' option.
1152
1153'INTERACTIVE'::
1154If a user is granted the priority capability with the 'INTERACTIVE' option,
1155regardless if they also have the 'BATCH' option or not, they are in the
1156'INTERACTIVE' thread pool.
1157
1158
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001159[[capability_queryLimit]]
1160Query Limit
1161~~~~~~~~~~~
1162
1163Allow site administrators to configure the query limit for users to
1164be above the default hard-coded value of 500. Administrators can add
1165a global block to `All-Projects` with group(s) that
1166should have different limits:
1167
1168When applying a query limit to a user the largest value granted by
1169any of their groups is used.
1170
1171This limit applies not only to the link:cmd-query.html[`gerrit query`]
1172command, but also to the web UI results pagination size.
1173
1174
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001175[[capability_startReplication]]
1176Start Replication
1177~~~~~~~~~~~~~~~~~
1178
Shawn O. Pearce7d2cb042012-05-10 19:12:09 -07001179Allow access to execute `replication start` command, if the
1180replication plugin is installed on the server.
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001181
1182
1183[[capability_viewCaches]]
1184View Caches
1185~~~~~~~~~~~
1186
Fredrik Luthander48603002012-03-21 18:17:17 +01001187Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001188the granted group to
1189link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1190
1191
Fredrik Luthander48603002012-03-21 18:17:17 +01001192[[capability_viewConnections]]
1193View Connections
1194~~~~~~~~~~~~~~~~
1195
1196Allow querying for status of Gerrit's current client connections. This
1197capability allows the granted group to
1198link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1199
1200
1201[[capability_viewQueue]]
1202View Queue
1203~~~~~~~~~~
1204
1205Allow querying for status of Gerrit's internal task queue. This capability
1206allows the granted group to
1207link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1208
1209
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001210GERRIT
1211------
1212Part of link:index.html[Gerrit Code Review]